Database Table Manager

The Database Table Manager tool allows project administrator to interactively manage the structure of database tables. This tool is based on a common system tool that is customized via a rule set defined in the configuration object "Database setup", as described in Diagram configuration objects, to support the P&ID table layout.

Start the tool by selecting the Parent-> icon from the CADMATIC desktop, and then Object > Manage Diagram Database. In the Manage Database Server dialog, click Manage Database Tables. You are prompted to specify whether to save the changes in the library or the project, and whether to first back up the P&ID database.

When the Database Table Manager tool opens, click Select Table to select the table to modify. When the specified table is opened, commands that are unavailable are dimmed. For example, you are not allowed to rename or delete default system tables such as ARMATURES.

Database Table Manager contains the following buttons and fields.

Button/Field

Description

Select Table

Opens a list of database tables for selecting the table to edit. You can use the search pattern field to jump to a specific item; for example, enter "PI_*" in the field and click Search Pattern to jump to the PI_CATALOG table.

New Table

Create new table with the data currently shown in the manager.

Save Table

Save the modification of the current table.

Rename Table

Save the modifications of the current table and rename it.

Delete Table

Delete current table.

Table

The name of the table.

Length of all visible fields

The visible length of all fields in editor views.

For example, if the maximum length of a field is 80 characters, setting this value to 10 allows only ten characters to be visible at a time in editor views.

If set to  -1, fields are fully visible in editor views (field length determines its visible length).

This global setting can be overridden with a column-specific setting.

Columns

The Columns pane lists the columns (fields) of the table. Select the one to modify from the list. The attributes of the selected column are shown, and you can modify the editable ones as needed.

--- Column Attributes ---

New

Saves the currently shown data in a new column.

Save

Saves the currently shown data in the active column.

Delete

Deletes the active column.

Up

Moves the active column up.

Down

Moves the active column down.

Name

Column name.

Name in DB editor

Column name to show in database editor. If not specified, the name specified in Name is shown.

Length of visible field

The visible length of the field in editor views.

If set to  -1, the field is fully visible in editor views.

Data Type

See the table Diagram Database Column Data Types below.

Is Key

Set to "Yes" if the column is a key type field (PosId, for example), and otherwise set to "No".

Editable

Specifies whether a user can edit the field. Non-editable fields can only be modified by the software or with scripts.

  • "Yes" – User can see and edit the field.
  • "No" – User cannot see the field.
  • "No, visible" – User can see the field but not edit it.

Min Value

Minimum value that can be entered when editing the data in a diagram.

Max Value

Maximum value that can be entered when editing the data in a diagram.

Quantity Type

Quantity type of a column that is of data type float or double. Quantity types supported by COS are listed in Quantity definitions and their units of measure.

Max Length

Maximum length of a column that is of type string or wstring. Note that string length cannot exceed the length of the corresponding attribute.

--- Attribute for publishing column ---

  • You can map a database field to a Plant Modeller attribute. See the attribute mapping example in Synchronizing document attribute and title box values.
  • The selected attribute's type must correspond with the column type. You can map a string or integer field to an enumerated or coded attribute. If it is a string type, the value is copied to the database field.

Change

Opens the Select Tag list for changing the current attribute mapping.

Select

Opens the Select Tag list for selecting an attribute to be linked to this database column.

Clear

Removes the attribute mapping of this column.

Close

Closes the Database Table Manager tool. The system saves the new table structure to COS and automatically checks the database structure.

Help

Opens this help topic.

A database column can be of the following data types:

Diagram Database Column Data Types

Data Type

Attributes

Content

Int, Short, Byte

Min Value, Max Value

Integer value, no unit type identifier.

Float, Double

Min Value, Max Value, Quantity Type, Format

Decimal value with unit type identifier.

String

Max Length, Variable Length

Text.

WString

Max Length, Variable Length

Text that can contain Unicode characters.

Synchronizing document attribute and title box values

Project administrator can enable values to be synchronized between the title box of a diagram and the associated COS document attributes, as described below.

  • If user edits COS attribute values in File > Manage Diagrams when diagram is checked in, the values are updated to the title box when the diagram is checked out.
  • If user edits the title box values of a checked-out diagram in File > Document > Edit Title Box, the values are updated to the COS attributes when the diagram is checked in or updated to COS.

Do the following:

  1. Open the Database Table Manager tool as described in Database Table Manager.

  2. Open the PI_CATALOG table.

  3. Map the required database column to a matching attribute.

    For example, to enable synchronization of the first description row of title boxes:

    1. In the Columns list, select the "DescriptionRow1" column.

    2. Click the Select button of the Generic Attribute setting, and select the "Description row1" COS attribute.

      The Attribute Name field displays that the "Description row1" title box attribute has been mapped to the "DescriptionRow1" database field.

  4. Click Save, and then Save Table.

  5. Click Close.